package by.airlanterns.dao;

import by.airlanterns.dto.Lantern;
import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Sergey
 * Date: 27.01.13
 * Time: 14:32
 * To change this template use File | Settings | File Templates.
 */
@Controller
public class LanternDaoImpl extends GenericDaoImpl<Lantern, Integer> {

    @Override
    protected Class<Lantern> getEntityClass() {
        return Lantern.class;
    }

    public List<Lantern> findLanternsByCategoryId(int id){
        return getHibernateTemplate().find("from "+Lantern.class.getName()+" where fk_id_category="+id);
    }


}
